[slug]-897fa94c363f0633.js 9.9 KB

12
  1. (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44279],{54110:function(e,n,t){"use strict";var s,r=t(67597);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var s in t)({}).hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},i.apply(null,arguments)}n.Z=function(e){return r.createElement("svg",i({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=r.createElement("path",{d:"M20.89 0H3.454C2.581 0 2 .581 2 1.453v20.344c0 .872.581 1.453 1.453 1.453h17.438c.872 0 1.453-.581 1.453-1.453V1.453C22.344.581 21.762 0 20.89 0ZM6.36 18.89c-.873 0-1.454-.58-1.454-1.453 0-.871.582-1.453 1.453-1.453.872 0 1.454.582 1.454 1.454 0 .871-.582 1.453-1.454 1.453Zm0-5.812c-.873 0-1.454-.581-1.454-1.453 0-.872.582-1.453 1.453-1.453.872 0 1.454.581 1.454 1.453 0 .872-.582 1.453-1.454 1.453Zm0-5.812c-.873 0-1.454-.582-1.454-1.454 0-.871.582-1.453 1.453-1.453.872 0 1.454.582 1.454 1.454 0 .871-.582 1.453-1.454 1.453Zm13.078 2.906h-8.72v-4.36h8.72v4.36Z",fill:"currentColor"})))}},3821:function(e,n,t){"use strict";var s,r,i=t(67597);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var s in t)({}).hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},a.apply(null,arguments)}n.Z=function(e){return i.createElement("svg",a({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=i.createElement("g",{clipPath:"url(#a)",fill:"currentColor"},i.createElement("path",{d:"M4.844 1H.969A.97.97 0 0 0 0 1.969v19.375a.97.97 0 0 0 .969.968h3.875V1ZM6.781 1v21.313h15.5a.97.97 0 0 0 .969-.97V1.97A.97.97 0 0 0 22.281 1h-15.5Zm3.875 3.875h2.906v1.938h-2.906V4.875Zm2.906 13.563h-2.906V16.5h2.906v1.938Zm2.907-3.875h-3.875v-1.938h3.875v1.938Zm2.906-3.876h-5.813V8.75h5.813v1.938Z"}))),r||(r=i.createElement("defs",null,i.createElement("clipPath",{id:"a"},i.createElement("path",{fill:"currentColor",d:"M0 0h23.25v23.25H0z"})))))}},50499:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/learning-plans/[slug]",function(){return t(51022)}])},65634:function(e,n,t){"use strict";t.d(n,{n:function(){return s}});var s,r=t(45361),i=t(57611),a=(t(67597),t(37014)),l=t.n(a),o=t(21471),c=t.n(o);!function(e){e.SMALL="small",e.MEDIUM="medium"}(s||(s={}));n.Z=function(e){var n,t=e.children,a=e.size,o=void 0===a?s.MEDIUM:a;return(0,i.jsx)("div",{className:l()(c().container,(n={},(0,r.Z)(n,c().medium,o===s.MEDIUM),(0,r.Z)(n,c().small,o===s.SMALL),n)),children:t})}},51022:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSG:function(){return oe},default:function(){return ce}});var s,r=t(57611),i=t(15129),a=t(61395),l=t(78170),o=t.n(l),c=t(45361),u=t(67597),d=t(26913),h=t.n(d),_=t(9083),v=t.n(_),m=t(85494),x=t(12195),f=t(84020),j=function(e){var n,t=e.course,s=e.isHeaderButton,l=void 0===s||s,o=(0,a.Z)("learn").t,c=t.lessons,u=t.continueFromLesson,d=t.id,h=t.slug,_=u||(null===c||void 0===c||null===(n=c[0])||void 0===n?void 0:n.slug),v=(0,i.useRouter)();return c.some((function(e){return!0===e.isCompleted}))?(0,r.jsx)(m.ZP,{onClick:function(){(0,x.MY)("continue_learning",{courseId:d,isHeaderButton:l}),v.push((0,f.dC)(h,_))},children:o("continue-learning")}):(0,r.jsx)(m.ZP,{onClick:function(){(0,x.MY)("start_learning",{courseId:d,isHeaderButton:l}),v.push((0,f.dC)(h,_))},children:o("start-learning")})},g=t(10440),p=t(57044),Z=t(16946),C=t(30067),b=t.n(C),y=t(31855),N=t(65634),M=t(85609),S=t(32607),E=t(9740),w=t(37572),I=t(19226),A=function(e){var n=e.course,t=e.isCTA,s=void 0!==t&&t,l=n.title,o=n.id,c=n.isUserEnrolled,d=n.slug,h=n.isCompleted,_=n.lessons,v=(0,u.useState)(!1),g=v[0],C=v[1],A=(0,M.useToast)(),k=(0,i.useRouter)(),D=(0,a.Z)("learn").t,L=(0,S.Z)(),P=function(){(0,I.jl)()?((0,x.MY)("user_enroll_course",{courseId:o,isCTA:s}),C(!0),(0,E.xh)(n.id).then((function(){A(D("enroll-success",{title:l}),{status:M.ToastStatus.Success}),L((0,w.vp)(d),(function(e){return(0,Z.Z)((0,p.Z)({},e),{isUserEnrolled:!0})})),(null===_||void 0===_?void 0:_.length)>0&&k.replace((0,f.dC)(d,_[0].slug))})).catch((function(){A(D("common:error.general"),{status:M.ToastStatus.Error})})).finally((function(){C(!1)}))):((0,x.MY)("guest_enroll_course",{courseId:o,isCTA:s}),k.replace((0,f.gk)((0,f.ES)(d))))};return s?!0===c?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)(m.ZP,{isDisabled:g,isLoading:g,onClick:P,children:D("enroll")}):h?(0,r.jsxs)("div",{className:b().completedContainer,children:[(0,r.jsx)(N.Z,{children:D("completed")}),!1===(null===n||void 0===n?void 0:n.userHasFeedback)&&(0,r.jsx)(y.Z,{course:n,source:y.E.CoursePage})]}):!0===c?(0,r.jsx)(j,{course:n}):(0,r.jsx)(m.ZP,{isDisabled:g,isLoading:g,onClick:P,children:D("enroll")})},k=t(1931),D=t(94945),L=t.n(D),P=function(e){var n=e.title,t=e.description;return(0,r.jsxs)("div",{className:L().container,children:[(0,r.jsxs)("div",{className:L().title,children:["".concat(n,": ")," "]}),(0,r.jsx)("span",{className:L().description,children:t})]})},B=t(3222),T=function(e){var n=e.course,t=(0,a.Z)("learn").t,s=n.description,i=n.dailyMinutes,l=n.lessons,o=void 0===l?[]:l;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(P,{title:t("learn-duration"),description:t("duration-daily",{dailyMins:i,days:o.length})}),(0,r.jsx)(k.iz,{children:(0,r.jsx)(P,{title:t("description"),description:(0,r.jsx)(B.Z,{isEditable:!1,defaultValue:s})})})]})},F=t(75784),H=t.n(F),U=function(e){var n=e.author;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:H().author,children:n.name})," ",(0,r.jsx)("span",{children:n.biography})]})},O=t(86021),Y=t.n(O),V=t(99574),K=t(57830),q=t(43609),z=function(e){var n=e.course,t=n.lessons,s=void 0===t?[]:t,i=n.slug,l=(0,a.Z)("learn"),o=l.t,c=l.lang,u=(0,I.jl)();return(0,r.jsx)("div",{className:Y().syllabusContainer,children:s.map((function(e,t){var s=t+1,a=e.title,l=e.isCompleted,d=e.id,h=e.slug,_=(0,f.dC)(i,h);return(0,r.jsxs)("p",{className:Y().container,children:[(0,r.jsx)("span",{className:Y().day,children:"".concat(o("day")," ").concat((0,q.rQ)(s,c))}),(0,r.jsxs)("span",{children:[": ",(0,r.jsx)(K.Z,{onClick:function(){return function(e,t){(0,x.MY)(u?"course_syllabus_day":"guest_course_syllabus_day",{courseId:n.id,dayNumber:e,lessonId:t})}(s,d)},href:u?_:(0,f.gk)(_),variant:K.r.Highlight,children:a}),l?(0,r.jsx)(V.Z,{}):""]})]},t)}))})},G=t(98385),R=t.n(G),W=function(e){var n=e.icon,t=e.value;return(0,r.jsxs)("div",{className:R().container,children:[n," ",(0,r.jsx)("p",{className:R().value,children:t})]})},J=t(71839),Q=t(54110),X=t(3821),$=t(21899);!function(e){e.MAIN="main",e.SYLLABUS="syllabus"}(s||(s={}));var ee=function(e){var n=e.course,t=n.title,i=n.image,l=n.id,o=(0,a.Z)("learn").t,d=(0,u.useState)(s.MAIN),_=d[0],p=d[1],Z=(0,u.useMemo)((function(){return[{name:(0,r.jsx)(W,{icon:(0,r.jsx)(Q.Z,{}),value:o("tabs.main")}),value:s.MAIN},{name:(0,r.jsx)(W,{icon:(0,r.jsx)(X.Z,{}),value:o("tabs.syllabus")}),value:s.SYLLABUS}]}),[o]),C=(0,u.useMemo)((function(){var e;return e={},(0,c.Z)(e,s.MAIN,(0,r.jsx)(T,{course:n})),(0,c.Z)(e,s.SYLLABUS,(0,r.jsx)(z,{course:n})),e}),[n]);return(0,r.jsxs)(g.Z,{children:[(0,r.jsxs)(m.ZP,{onClick:function(){(0,x.MY)("back_to_courses_course_details",{courseId:l})},href:(0,f.ty)(),variant:m.Wu.Ghost,children:[(0,r.jsx)($.Z,{}),(0,r.jsx)("p",{className:v().backText,children:o("back-to-learning-plans")})]}),(0,r.jsxs)("div",{className:v().headerContainer,children:[(0,r.jsx)("div",{children:(0,r.jsx)("p",{className:v().title,children:t})}),(0,r.jsx)(A,{course:n})]}),(0,r.jsx)("div",{className:v().imgContainer,children:(0,r.jsx)(h(),{alt:t,src:i,layout:"fill"})}),(0,r.jsx)(J.Z,{selected:_,items:Z,onSelect:function(e){(0,x.Kz)("course_details_tab_change",{courseId:l,tab:e}),p(e)}}),C[_],_===s.MAIN&&(0,r.jsxs)(r.Fragment,{children:[!n.isUserEnrolled&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(A,{course:n,isCTA:!0})}),(0,r.jsx)(P,{title:o("about-author"),description:(0,r.jsx)(U,{author:n.author})}),n.isUserEnrolled&&(0,r.jsx)("div",{className:v().startLearningButton,children:(0,r.jsx)(j,{course:n,isHeaderButton:!1})})]})]})},ne=t(73756),te=t(21648),se=t(55673),re=t(10117),ie=t(86719),ae=t.n(ie),le=function(){return(0,r.jsx)("div",{className:ae().loadingContainer,children:(0,r.jsx)(re.Z,{})})},oe=!0,ce=function(e){var n=e.course,t=(0,a.Z)("learn"),s=t.lang,l=t.t,c=(0,i.useRouter)().query.slug,u=(0,f.ES)(n.slug);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(te.Z,{title:n.title,canonical:(0,f.Z2)(s,u),description:(null===n||void 0===n?void 0:n.metaDescription)||l("learning-plan-meta-desc"),languageAlternates:(0,q.qc)(u)}),(0,r.jsx)("div",{className:ae().pageContainer,children:(0,r.jsx)("div",{className:o().container,children:(0,r.jsx)(se.Z,{children:(0,r.jsx)(ne.Z,{loading:le,queryKey:(0,w.vp)(c),fetcher:E.UK,render:function(e){return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(ee,{course:e})})}})})})})]})}},9083:function(e){e.exports={backText:"CourseDetails_backText__8Hu7e",headerContainer:"CourseDetails_headerContainer__0KFWS",title:"CourseDetails_title__WmnyB",author:"CourseDetails_author__C0c06",imgContainer:"CourseDetails_imgContainer__iJ_rf",startLearningButton:"CourseDetails_startLearningButton__vdo76"}},30067:function(e){e.exports={completedContainer:"StatusHeader_completedContainer__DjKg6"}},98385:function(e){e.exports={container:"TabSwitcherItem_container__l0AFM",value:"TabSwitcherItem_value__9Zast"}},75784:function(e){e.exports={author:"AuthorDetail_author__QNqjO"}},94945:function(e){e.exports={title:"DetailSection_title__4mbZq",container:"DetailSection_container__CnjV5"}},86021:function(e){e.exports={syllabusContainer:"Syllabus_syllabusContainer__3hJSK",container:"Syllabus_container__vPuDB",day:"Syllabus_day__jG8s6"}},21471:function(e){e.exports={container:"Pill_container__FoIEg",small:"Pill_small__zCILo"}},78170:function(e){e.exports={container:"courses_container__h1_I3"}}},function(e){e.O(0,[46911,15240,26913,41167,47995,22042,49774,92888,40179],(function(){return n=50499,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
  2. //# sourceMappingURL=[slug]-897fa94c363f0633.js.map